{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/* eslint-disable react/no-unknown-property */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport isMobile from \"rc-util/es/isMobile\";\n/**\n * When click and hold on a button - the speed of auto changing the value.\n */\nvar STEP_INTERVAL = 200;\n/**\n * When click and hold on a button - the delay before auto changing the value.\n */\nvar STEP_DELAY = 600;\nexport default function StepHandler(_ref) {\n  var prefixCls = _ref.prefixCls,\n    upNode = _ref.upNode,\n    downNode = _ref.downNode,\n    upDisabled = _ref.upDisabled,\n    downDisabled = _ref.downDisabled,\n    onStep = _ref.onStep;\n  // ======================== Step ========================\n  var stepTimeoutRef = React.useRef();\n  var onStepRef = React.useRef();\n  onStepRef.current = onStep;\n  // We will interval update step when hold mouse down\n  var onStepMouseDown = function onStepMouseDown(e, up) {\n    e.preventDefault();\n    onStepRef.current(up);\n    // Loop step for interval\n    function loopStep() {\n      onStepRef.current(up);\n      stepTimeoutRef.current = setTimeout(loopStep, STEP_INTERVAL);\n    }\n    // First time press will wait some time to trigger loop step update\n    stepTimeoutRef.current = setTimeout(loopStep, STEP_DELAY);\n  };\n  var onStopStep = function onStopStep() {\n    clearTimeout(stepTimeoutRef.current);\n  };\n  React.useEffect(function () {\n    return onStopStep;\n  }, []);\n  // ======================= Render =======================\n  if (isMobile()) {\n    return null;\n  }\n  var handlerClassName = \"\".concat(prefixCls, \"-handler\");\n  var upClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-up\"), _defineProperty({}, \"\".concat(handlerClassName, \"-up-disabled\"), upDisabled));\n  var downClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-down\"), _defineProperty({}, \"\".concat(handlerClassName, \"-down-disabled\"), downDisabled));\n  var sharedHandlerProps = {\n    unselectable: 'on',\n    role: 'button',\n    onMouseUp: onStopStep,\n    onMouseLeave: onStopStep\n  };\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(handlerClassName, \"-wrap\")\n  }, /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n    onMouseDown: function onMouseDown(e) {\n      onStepMouseDown(e, true);\n    },\n    \"aria-label\": \"Increase Value\",\n    \"aria-disabled\": upDisabled,\n    className: upClassName\n  }), upNode || /*#__PURE__*/React.createElement(\"span\", {\n    unselectable: \"on\",\n    className: \"\".concat(prefixCls, \"-handler-up-inner\")\n  })), /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n    onMouseDown: function onMouseDown(e) {\n      onStepMouseDown(e, false);\n    },\n    \"aria-label\": \"Decrease Value\",\n    \"aria-disabled\": downDisabled,\n    className: downClassName\n  }), downNode || /*#__PURE__*/React.createElement(\"span\", {\n    unselectable: \"on\",\n    className: \"\".concat(prefixCls, \"-handler-down-inner\")\n  })));\n}","map":{"version":3,"names":["_extends","_defineProperty","React","classNames","isMobile","STEP_INTERVAL","STEP_DELAY","StepHandler","_ref","prefixCls","upNode","downNode","upDisabled","downDisabled","onStep","stepTimeoutRef","useRef","onStepRef","current","onStepMouseDown","e","up","preventDefault","loopStep","setTimeout","onStopStep","clearTimeout","useEffect","handlerClassName","concat","upClassName","downClassName","sharedHandlerProps","unselectable","role","onMouseUp","onMouseLeave","createElement","className","onMouseDown"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-input-number/es/StepHandler.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/* eslint-disable react/no-unknown-property */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport isMobile from \"rc-util/es/isMobile\";\n/**\n * When click and hold on a button - the speed of auto changing the value.\n */\nvar STEP_INTERVAL = 200;\n/**\n * When click and hold on a button - the delay before auto changing the value.\n */\nvar STEP_DELAY = 600;\nexport default function StepHandler(_ref) {\n  var prefixCls = _ref.prefixCls,\n    upNode = _ref.upNode,\n    downNode = _ref.downNode,\n    upDisabled = _ref.upDisabled,\n    downDisabled = _ref.downDisabled,\n    onStep = _ref.onStep;\n  // ======================== Step ========================\n  var stepTimeoutRef = React.useRef();\n  var onStepRef = React.useRef();\n  onStepRef.current = onStep;\n  // We will interval update step when hold mouse down\n  var onStepMouseDown = function onStepMouseDown(e, up) {\n    e.preventDefault();\n    onStepRef.current(up);\n    // Loop step for interval\n    function loopStep() {\n      onStepRef.current(up);\n      stepTimeoutRef.current = setTimeout(loopStep, STEP_INTERVAL);\n    }\n    // First time press will wait some time to trigger loop step update\n    stepTimeoutRef.current = setTimeout(loopStep, STEP_DELAY);\n  };\n  var onStopStep = function onStopStep() {\n    clearTimeout(stepTimeoutRef.current);\n  };\n  React.useEffect(function () {\n    return onStopStep;\n  }, []);\n  // ======================= Render =======================\n  if (isMobile()) {\n    return null;\n  }\n  var handlerClassName = \"\".concat(prefixCls, \"-handler\");\n  var upClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-up\"), _defineProperty({}, \"\".concat(handlerClassName, \"-up-disabled\"), upDisabled));\n  var downClassName = classNames(handlerClassName, \"\".concat(handlerClassName, \"-down\"), _defineProperty({}, \"\".concat(handlerClassName, \"-down-disabled\"), downDisabled));\n  var sharedHandlerProps = {\n    unselectable: 'on',\n    role: 'button',\n    onMouseUp: onStopStep,\n    onMouseLeave: onStopStep\n  };\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(handlerClassName, \"-wrap\")\n  }, /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n    onMouseDown: function onMouseDown(e) {\n      onStepMouseDown(e, true);\n    },\n    \"aria-label\": \"Increase Value\",\n    \"aria-disabled\": upDisabled,\n    className: upClassName\n  }), upNode || /*#__PURE__*/React.createElement(\"span\", {\n    unselectable: \"on\",\n    className: \"\".concat(prefixCls, \"-handler-up-inner\")\n  })), /*#__PURE__*/React.createElement(\"span\", _extends({}, sharedHandlerProps, {\n    onMouseDown: function onMouseDown(e) {\n      onStepMouseDown(e, false);\n    },\n    \"aria-label\": \"Decrease Value\",\n    \"aria-disabled\": downDisabled,\n    className: downClassName\n  }), downNode || /*#__PURE__*/React.createElement(\"span\", {\n    unselectable: \"on\",\n    className: \"\".concat(prefixCls, \"-handler-down-inner\")\n  })));\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE;AACA,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C;AACA;AACA;AACA,IAAIC,aAAa,GAAG,GAAG;AACvB;AACA;AACA;AACA,IAAIC,UAAU,GAAG,GAAG;AACpB,eAAe,SAASC,WAAW,CAACC,IAAI,EAAE;EACxC,IAAIC,SAAS,GAAGD,IAAI,CAACC,SAAS;IAC5BC,MAAM,GAAGF,IAAI,CAACE,MAAM;IACpBC,QAAQ,GAAGH,IAAI,CAACG,QAAQ;IACxBC,UAAU,GAAGJ,IAAI,CAACI,UAAU;IAC5BC,YAAY,GAAGL,IAAI,CAACK,YAAY;IAChCC,MAAM,GAAGN,IAAI,CAACM,MAAM;EACtB;EACA,IAAIC,cAAc,GAAGb,KAAK,CAACc,MAAM,EAAE;EACnC,IAAIC,SAAS,GAAGf,KAAK,CAACc,MAAM,EAAE;EAC9BC,SAAS,CAACC,OAAO,GAAGJ,MAAM;EAC1B;EACA,IAAIK,eAAe,GAAG,SAASA,eAAe,CAACC,CAAC,EAAEC,EAAE,EAAE;IACpDD,CAAC,CAACE,cAAc,EAAE;IAClBL,SAAS,CAACC,OAAO,CAACG,EAAE,CAAC;IACrB;IACA,SAASE,QAAQ,GAAG;MAClBN,SAAS,CAACC,OAAO,CAACG,EAAE,CAAC;MACrBN,cAAc,CAACG,OAAO,GAAGM,UAAU,CAACD,QAAQ,EAAElB,aAAa,CAAC;IAC9D;IACA;IACAU,cAAc,CAACG,OAAO,GAAGM,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